"""
该文件用于 保存页面
"""
import uiautomation as auto
from page.base_page import BasePage
from utils.utils_log import loggerCase

class SavePage(BasePage):
    """保存页面"""

    # 保存到本地
    __save_button = auto.GroupControl(SubName="toolBarImg/Save")

    # P3文件格式
    __p3_type_file = auto.CheckBoxControl(Name='.p3')

    # asc的whole scan文件格式
    __asc_whole_scan_type_file = auto.CheckBoxControl(Name=".asc(<font size='2'>Whole scan</font>)")

    # asc的global markers文件格式
    __asc_global_markers_type_file = auto.CheckBoxControl(Name=".asc (global markers)")

    # stl文件格式
    __stl_type_file = auto.CheckBoxControl(Name='.stl')

    # obj文件格式
    __obj_type_file = auto.CheckBoxControl(Name='.obj')

    # ply文件格式
    __ply_type_file = auto.CheckBoxControl(Name='.ply')

    # 3mf文件格式
    __3mf_type_file = auto.CheckBoxControl(Name='.3mf')

    # txt文件格式
    __txt_type_file = auto.CheckBoxControl(Name='.txt')

    def choose_save_button(self, max_wait_time=3):
        """保存"""
        loggerCase.info("点击保存")
        self.click(SavePage.__save_button, max_wait_time=max_wait_time)

    def choose_save_p3_file(self, max_wait_time=3):
        """保存P3格式"""
        loggerCase.info("点击保存P3格式")
        self.click(SavePage.__p3_type_file, max_wait_time=max_wait_time)

    def choose_save_stl_file(self, max_wait_time=3):
        """保存stl格式"""
        loggerCase.info("点击保存stl格式")
        self.click(SavePage.__stl_type_file, max_wait_time=max_wait_time)

    def choose_save_asc_whole_scan_type_file(self, max_wait_time=3):
        """保存asc的WholeScan格式"""
        loggerCase.info("点击保存asc的whole scan格式")
        self.click(SavePage.__asc_whole_scan_type_file, max_wait_time=max_wait_time)

    def choose_save_asc_global_markers_type_file(self, max_wait_time=3):
        """保存asc的GlobalMarkers格式"""
        loggerCase.info("点击保存asc的global markers格式")
        self.click(SavePage.__asc_global_markers_type_file, max_wait_time=max_wait_time)

    def choose_save_obj_file(self, max_wait_time=3):
        """保存obj格式"""
        loggerCase.info("点击保存obj格式")
        self.click(SavePage.__obj_type_file, max_wait_time=max_wait_time)

    def choose_save_ply_file(self, max_wait_time=3):
        """保存ply格式"""
        loggerCase.info("点击保存ply格式")
        self.click(SavePage.__ply_type_file, max_wait_time=max_wait_time)

    def choose_save_3mf_file(self, max_wait_time=3):
        """保存3mf格式"""
        loggerCase.info("点击保存3mf格式")
        self.click(SavePage.__3mf_type_file, max_wait_time=max_wait_time)

    def choose_save_txt_file(self, max_wait_time=3):
        """保存txt格式"""
        loggerCase.info("点击保存txt格式")
        self.click(SavePage.__txt_type_file, max_wait_time=max_wait_time)